package com.harry.resource.inner.module.mgr;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.harry.configuration.ConstSettings;
import com.harry.decoupling.defi.tool.NotificationManager;
import com.harry.decoupling.impl.module.RestfulMgrImpl;
import com.harry.resource.inner.entity.InnerNotificationRecord;
import com.harry.utility.BeanCtxUtils;

public class InnerNotificationRestfulMgr extends RestfulMgrImpl<InnerNotificationRecord> {

	@Override
	public void post(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response, Map<String, Object> data) throws Exception {
		super.post(params, request, response, data);
		BeanCtxUtils.getBeanByType(NotificationManager.class).push((InnerNotificationRecord) data.get("data"));
	}

	@Override
	public void patch(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response, Map<String, Object> data) throws Exception {
		throw ConstSettings.NOT_ALLOW;
	}

	@Override
	public void delete(Map<String, Object> params, HttpServletRequest request, HttpServletResponse response, Map<String, Object> data) throws Exception {
		throw ConstSettings.NOT_ALLOW;
	}
}
